# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-user-agent
pkgname=('python2-user-agent' 'python-user-agent')
_pkgname=user-agent
__pkgname=user_agent
pkgver=0.1.10
pkgrel=1
pkgdesc='User-Agent generator.'
arch=('any')
url='https://pypi.org/project/user_agent/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/user_agent-$pkgver.tar.gz")
sha512sums=('44331d2cbec7779c9370032c91027c634ab86cb886fdf631708d0a7457d23410910b51a6466b535dc5a14e4b55ddf15246b0e0d6cf3cc824b5162906bdad17a4')

prepare() {
  cp -a "$__pkgname-$pkgver"{,-2}
}

build() {
  cd "$__pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$__pkgname-$pkgver"

  python setup.py build
}

package_python2-user-agent() {
  depends=('python2-six')

  cd "$__pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-user-agent() {
  depends=('python-six')

  cd "$__pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

